import React, { Component } from 'react';
import {
	StyleSheet, Text, View, Image, Platform, TouchableOpacity, PixelRatio,
	ActivityIndicator, ScrollView, FlatList, DeviceEventEmitter
} from "react-native";
import { API, API_GENERATE } from '../../../config/api';
import Dictionary from '../../../utils/dictionary';
import StorageHelper from '../../../utils/storageHelper';
import HTTP from '../../../utils/http';
import ValidateDataUtil from '../../../utils/ValidateDataUtil';
import MethodUtil from '../../../utils/MethodUtil';
import { STORAGE_CONSTANT } from '../../../config/storage';
import { GLOBAL } from '../../../config/global';
import { style } from '../../../theme/style';
import LogoComponent from '../../../component/LogoComponent';
import { Common } from '../../../component/common/Common.js'
import ScrollableTabView, { ScrollableTabBar } from 'react-native-scrollable-tab-view';
import { LargeBtn } from '../../requirement-plan/component/Component.js';
import { OptionCheck } from '../_components/Component';
import { CURRENCY } from '../../../utils/helper';
import { StatusModel } from '../../../component/Store';
import { CreditTabs, CreditFilterTabs } from './_components/Tabs';
import { CreditInfoSection } from './_components/CreditInfoSection';
import { BoxShadow } from 'react-native-shadow';
import { CreditHistoryItem } from './_components/CreditHistoryItem';
var appInfo = require('react-native-device-info');

const enterpriseEdit = require('../../../imgs/global/edit.png');
const emptyImgDetail = require('../../../imgs/customer/emptyImgDetail.png');

const scale = GLOBAL.SCALE;
const shadowOpt = {
	width: 351 * scale,
	height: 196 * scale,
	color: "#0E7FFD",//阴影颜色
	border: 16 * scale,//阴影宽度
	radius: 10 * scale,//包裹的子元素圆角多少这里必须是多少
	opacity: 0.2,//透明度
	x: 15,
	y: -20,
}

const qualificationUriObj = {

};
const qualificationTypeObj = {};
const companyPropObj = {};
const prohibitSource = require('../../../imgs/customer/prohibit.png');
const emptyPic = require('../../../imgs/global/dealtWithEmpty.png');
const panelViewBorder = Platform.OS == 'android' ? { borderColor: '#F1F1F1', borderWidth: 1 / PixelRatio.get(), } : null;
let loadedCell = null;
let pageNo = 1;//当前第几页
let pageQualificationNo = 1;//当前第几页
let totalPage = 0;//当前第几页
let totalQualificationPage = 0;//当前第几页

export class EnterpriseDetailPage extends Component {

	constructor(props) {
		super(props);
		this.state = {
			qualificationUriLoaded: true,
			enterpriseInfo: {
				acctList: {},
				invoiceVO: {},
				companyInfoVO: {},
				qualificationListPage: [],
				companyStandBook: {      //1是预付，2是赊销
					1: {},
					2: {}
				},
				orderInfoList: {},
				isLeader: false,
			},
			loaded: true,
			modifyloaded: true,
			curMenu: 'info',
			creditFileSource: null,
			taxQualificationFileSource: null,
			logoUri: null,
			companyPropStr: '',
			dataAddressSource: [],
			dataQualificationSource: [],
			optionCheck: {
				modalVisible: false,
				data: [],
				checkObj: {}
			},
			currentCreditType: 1,  //1是预付，2是赊销
			creditApplyStatus: '',
			creditList: [],
			creditFitlerTypes: [],
		};

		this.currentCreditType = this.props.navigation.state.params.currentCreditType || null;
		this.creditApplyStatus = this.props.navigation.state.params.creditApplyStatus || null;
		this.companyId = this.props.navigation.state.params.companyId;
		this.id = this.props.navigation.state.params.id;
		this.menuKey = this.props.navigation.state.params.menuKey || '';
		this.initialPage = this.props.navigation.state.params.initialPage || 0;
		this.menuData = [];
		if (this.menuKey && this.menuKey == 'info') {
			this.menuData = [
				{ key: 'info', text: '基本信息', modifyBizType: 'COMPANYINFO', modifyRecordsKey: 'companyInfoList' }
			];
		} else {
			this.menuData = [
				{ key: 'info', text: '基本信息', modifyBizType: 'COMPANYINFO', modifyRecordsKey: 'companyInfoList' },
				{ key: 'invoice', text: '开票信息', modifyBizType: 'INVOICE', modifyRecordsKey: 'invoiceList' },
				{ key: 'account', text: '银行信息', modifyBizType: 'ACCT', modifyRecordsKey: 'acctList' },
				{ key: 'address', text: '出入库地址', modifyBizType: 'ADDRESS', modifyRecordsKey: 'addressListPage' },
				{ key: 'qualification', text: '资质信息', modifyBizType: 'QUALIFICATION', modifyRecordsKey: 'qualificationListPage' },
				{ key: 'contact', text: '联系人信息', modifyBizType: 'CONTACTOR', modifyRecordsKey: 'contactorList' },
				{ key: 'product', text: '商品信息', modifyBizType: 'GOODS', modifyRecordsKey: 'goodsList' },
				{ key: 'standBook', text: '授信', modifyBizType: 'GOODS', modifyRecordsKey: 'goodsList' },
				{ key: 'orderInfo', text: '交易信息', modifyBizType: 'GOODS', modifyRecordsKey: 'goodsList' },
				{ key: 'other', text: '其他', modifyBizType: 'INVOICE', modifyRecordsKey: 'invoiceList' },
			];
		}

		this.sendData = {
			// bizType: 'COMPANYINFO',
			companyId: this.companyId
		}
		this._getContactorView = this._getContactorView.bind(this);
		this._getGoodsView = this._getGoodsView.bind(this);
		this._renderContent = this._renderContent.bind(this);
		this._getOrderInfoView = this._getOrderInfoView.bind(this);

		this.companyInfoList = [];
		this.acctList = [];
		this.addressListPage = [];
		this.qualificationListPage = [];
		this.contactorList = [];
		this.goodsList = [];
		this.orderInfoList = [];


		this._closeLightBox = this._closeLightBox.bind(this);

		this.stateLightBoxData = {
			onClosePress: this._closeLightBox,
			modalVisible: false,
			title: '',
			rowDataList: [],
		};
	}

	static navigationOptions = ({ navigation }) => {
		const backIcon = require('../../../imgs/global/backWhite.png');
		const backIconStyle = { width: 20 * scale, resizeMode: 'contain', marginLeft: 10 * scale }
		return {
			headerTitle: navigation.getParam('title', '企业详情'),
			headerLeft: <Common type="headLeft" onPress={() => { navigation.goBack() }} color='#fff' />,
			headerStyle: {
				elevation: 0,
				borderBottomWidth: 0,
				backgroundColor: style.color.themeColor,
			},
			headerTintColor: '#fff',
			// headerLeft: <TouchableOpacity onPress={() => navigation.goBack()} activeOpacity={0.5}><Image source={backIcon} style={backIconStyle} /></TouchableOpacity>
		};
	};

	async checkIfEdit (staffCompanyList, holdStatus) {
		const { status } = this.props.navigation.state.params;
		const userInfoJson = await StorageHelper.get(STORAGE_CONSTANT.USER_INFO_KEY);
		const userInfo = JSON.parse(userInfoJson);

		//过滤业务经办人中是否含有当前登录人，如果有，则可以进行编辑等操作
		const staff = staffCompanyList.length ? staffCompanyList.filter((item, index) => {
			return item.staffId === userInfo.userId;
		}) : [];
		if (!holdStatus) {
			this.setState({
				ifEdit: staff.length && status === 'PASS'
			})
		}
	}

	render () {
		const { loaded, refuseModalVisible, optionCheck } = this.state;
		loadedCell = loaded ?
			<View style={styles.loadedCell}>
				<ActivityIndicator
					animating={true}
					color={'#fff'}
					size="small"
				/>
			</View> : null;
		const scrollableTabView = this.menuData.map(item => {
			const { key, text } = item;
			return (
				<View tabLabel={text} key={key}>
					{key == 'address' || key == 'qualification' ?
						<View style={{ height: '100%', paddingBottom: 74 * scale }}>
							<View style={styles.panelCellView}>
								<View style={styles.panelViewTop}></View>
								{this._renderContent(key)}
							</View>
						</View>
						: <ScrollView>
							<View style={styles.panelCellView}>
								<View style={styles.panelViewTop}></View>
								{this._renderContent(key)}
							</View>
						</ScrollView>}
				</View>
			);
		});
		return (
			<View style={{ flex: 1, backgroundColor: style.color.bgGray }}>
				<ScrollableTabView
					initialPage={this.initialPage}
					locked={this.state.loaded}
					renderTabBar={() => <ScrollableTabBar style={{ borderBottomWidth: 0 }} />}
					tabBarBackgroundColor={style.color.themeColor}
					tabBarActiveTextColor='#fff'
					tabBarInactiveTextColor='#fff'
					tabBarUnderlineStyle={styles.tabBarUnderline}
					tabBarTextStyle={{ fontSize: 12 * scale }}
				>
					{scrollableTabView}
				</ScrollableTabView>
				<OptionCheck {...optionCheck} />
			</View>
		);
	}

	_renderContent (curMenu) {
		const { enterpriseInfo, optionCheck, qualificationType, ifEdit } = this.state;
		const { companyInfoVO, staffCompanyList } = enterpriseInfo;
		let staffNames = '';
		if (staffCompanyList && staffCompanyList.length) {
			const staffNameList = staffCompanyList.map((staff) => {
				const { staffName } = staff;
				return staffName;
			})
			staffNames = staffNameList.join(',');
		}
		if (curMenu == 'info') {
			//基本信息
			return (
				<View style={styles.panelViewContainer}>
					<View style={[styles.panelView, panelViewBorder]} >
						<View style={[styles.infoCell, { borderBottomWidth: 0 }]}>
							<View style={[styles.infoCellRow]}>
								<LogoComponent logoPath={this.state.logoUri} height={58} width={58} style={{ marginRight: 6 * scale, }} />
								<View style={[styles.infoCellRowRight, { paddingLeft: 12 * scale }]}>
									<View style={[styles.panelRowTop]}>
										<View style={[styles.panelRowTopLeft]}>
											<Text style={styles.enterpriseText}>{companyInfoVO.companyName}</Text>
										</View>
									</View>
									<View style={[styles.explainCell]}>
										<Text style={styles.explainText}>{companyInfoVO.englishName}</Text>
										<Text style={styles.explainText}>{companyInfoVO.descriptions}</Text>
									</View>
								</View>
							</View>
						</View>

						<PanelRow leftText={'曾用名'} rightText={companyInfoVO.usedName} />
						{/* <PanelRow leftText={'企业简称'} rightText={companyInfoVO.aliasName} /> */}
						<PanelRow leftText={'注册资本'} rightText={(companyInfoVO.registerFund || '') + '万' + CURRENCY.getUnit(companyInfoVO.registerFundCurrency).text} />
						<PanelRow leftText={'合作关系'} rightText={this.state.companyCorpStr} />
						<PanelRow leftText={'企业属性'} rightText={this.state.companyPropStr} />
						<PanelRow leftText={'资本性质'} rightText={companyInfoVO.companyNatureName} />
						<PanelRow leftText={'法定代表人'} rightText={companyInfoVO.legalName} />
						<PanelRow leftText={'企业地址'} rightText={companyInfoVO.registAddress} />

						{/* <PanelRow leftText={'纳税人识别号'} rightText={companyInfoVO.taxCode} /> */}

						<PanelRow leftText={'联系电话'} rightText={companyInfoVO.linkPhone} />
						{companyInfoVO.fax ? <PanelRow leftText={'传真'} rightText={companyInfoVO.fax} /> : null}
						{companyInfoVO.recvInvoiceAddress ? <PanelRow leftText={'发票邮寄地址'} rightText={companyInfoVO.recvInvoiceAddress} /> : null}
						<PanelRow leftText={'开票电话'} rightText={companyInfoVO.invoicePhoneNo} />
						<PanelRow leftText={'经办人'} rightText={staffNames} />
						<PanelRow leftText={'统一社会信用代码'} rightText={companyInfoVO.creditCode} />
						<PanelRow leftText={'统一社会信用证文件'} rightText={''} borderStyle={true} />
						{this._renderAttachmentView('creditFileSource')}

						{loadedCell}
					</View >
				</View>
			);
		} else if (curMenu == 'account') {
			if (enterpriseInfo.acctList && enterpriseInfo.acctList.length) {
				const contentHeight = (enterpriseInfo.acctList.length < 3) ? styles.contentHeight : styles.content;
				return (
					<View style={[contentHeight, { marginRight: 22 * scale }]}>
						<View style={styles.panelViewContainer}>
							{/* <View style={[styles.panelView, panelViewBorder, { paddingBottom: 12 * scale }]}> */}
							{
								enterpriseInfo.acctList.map((item, index) => {
									//银行信息
									const { openBankName, openAcctNo, effectDate, expireDate, openBankNo } = item;
									return (
										<View key={index} style={[styles.contentHeight]}>
											<View style={[styles.panelView, panelViewBorder]}>
												<View style={[styles.panelRowTop]}>
													<View style={[styles.panelRowTopLeft]}>
														<Text style={styles.panelRowTopText}>开户银行</Text>
													</View>
												</View>
												<PanelRow leftText={'开户银行'} rightText={openBankName} />
												<PanelRow leftText={'开户账号'} rightText={openAcctNo} borderStyle={true} />
											</View>
										</View>
									);
								})
							}
							{/* </View> */}
						</View>
					</View>
				);
			} else {
				return (
					<View style={styles.contentHeight}>
						<View style={styles.panelViewContainer}>
							<View style={[styles.panelView, styles.panelEmptyView, panelViewBorder]}>
								<Image source={emptyPic} style={styles.emptyPic} />
								<Text style={styles.emptyText}>没有银行信息</Text>
							</View>
						</View>
					</View>
				);
			}

		} else if (curMenu == 'address') {
			const addBtn = ifEdit ?
				<LargeBtn onPress={() => {
					const { navigate } = this.props.navigation;
					navigate('EnterpriseEditAddressPage', {
						goBack: 'EnterpriseDetailPage',
						companyAddress: {
							companyId: this.companyId,
							id: this.id,
						},
						companyName: enterpriseInfo.companyInfoVO.companyName,
					})
				}} text={'添加地址'} />
				: null
			//地址信息
			if (enterpriseInfo.addressListPage && enterpriseInfo.addressListPage.rows && enterpriseInfo.addressListPage.rows.length) {
				const contentHeight = (enterpriseInfo.addressListPage.rows.length < 3) ? styles.contentHeight : styles.content;
				const addressView = this.renderAddressData();
				return (
					<View style={contentHeight}>
						<View style={styles.panelViewContainer}>
							{addressView}
						</View>
						{this.state.loaded ? null : addBtn}
					</View>
				);
			} else {
				return (
					<View style={styles.contentHeight}>
						<View style={styles.panelViewContainer}>
							<View style={[styles.panelView, styles.panelEmptyView, panelViewBorder]}>
								<Image source={emptyPic} style={styles.emptyPic} />
								<Text style={styles.emptyText}>没有地址信息</Text>
							</View>
						</View>
						{addBtn}
					</View>
				);
			}
		} else if (curMenu == 'qualification') {
			const addBtn = ifEdit ?
				<LargeBtn onPress={() => {
					this.setState({
						optionCheck: {
							title: '新增资质',
							data: this.qualificationTypeList,
							modalVisible: true,
							checkObj: optionCheck.checkObj,
							onBgPress: () => {
								this.onModalBgPress(this.qualificationTypeList);
							},
							onPress: (index) => {
								this.onModalItemPress('companyNature', this.qualificationTypeList, index);
							}
						}
					});
				}} text={'添加资质'} />
				: null

			if (enterpriseInfo.qualificationListPage && enterpriseInfo.qualificationListPage.rows && enterpriseInfo.qualificationListPage.rows.length > 0) {
				const contentHeight = (enterpriseInfo.qualificationListPage.rows.length < 5) ? styles.contentHeight : styles.content;
				const qualificationView = this.renderQualificationData();
				return (
					<View style={contentHeight}>
						<View style={styles.panelViewContainer}>
							<View style={[styles.panelView, panelViewBorder, { paddingBottom: 12 * scale }]}>
								<View style={[styles.infoItem, { paddingBottom: 6 * scale }]}>
									{qualificationView}
								</View>
							</View>
						</View>
						{this.state.loaded ? null : addBtn}
					</View>
				);
			} else {
				return (
					<View style={styles.contentHeight}>
						<View style={styles.panelViewContainer}>
							{
								!this.state.loaded ? <View style={[styles.panelView, styles.panelEmptyView, panelViewBorder]}>
									<Image source={emptyPic} style={styles.emptyPic} />
									<Text style={styles.emptyText}>没有资质信息</Text>
								</View> :
									<View style={[styles.panelView, styles.panelEmptyView, panelViewBorder]}>
										<View style={styles.loadedCell}>
											<ActivityIndicator
												animating={true}
												color={'#fff'}
												size="small"
											/>
										</View>
									</View>
							}


						</View>
						{addBtn}
					</View>);
			}

		} else if (curMenu == 'contact') {
			const addBtn = ifEdit ?
				<LargeBtn onPress={() => {
					const { navigate } = this.props.navigation;
					navigate('EnterpriseEditContactPage', {
						companyName: enterpriseInfo.companyInfoVO.companyName,
						countryCode: enterpriseInfo.companyInfoVO.countryCode,
						vo: {
							companyId: this.companyId,
							id: this.id
						}
					})
				}} text={'添加联系人'} />
				: null
			//联系人信息
			if (enterpriseInfo.contactorList && enterpriseInfo.contactorList.length) {
				const contactorView = this._getContactorView();
				const contentHeight = (enterpriseInfo.contactorList.length < 2) ? styles.contentHeight : styles.content;
				return (
					<View style={contentHeight}>
						<View style={styles.panelViewContainer}>
							{contactorView}
						</View>
						{addBtn}
					</View>
				);
			} else {
				return (
					<View style={styles.contentHeight}>
						<View style={styles.panelViewContainer}>
							<View style={[styles.panelView, styles.panelEmptyView, panelViewBorder]}>
								<Image source={emptyPic} style={styles.emptyPic} />
								<Text style={styles.emptyText}>没有联系人信息</Text>
							</View>
						</View>
						{addBtn}
					</View>);
			}
		} else if (curMenu == 'product') {
			if (enterpriseInfo.goodsList && enterpriseInfo.goodsList && enterpriseInfo.goodsList.length) {
				const goodsView = this._getGoodsView();
				const contentHeight = (enterpriseInfo.goodsList.length < 5) ? styles.contentHeight : styles.content;
				return (
					<View style={contentHeight}>
						<View style={styles.panelViewContainer}>
							{goodsView}
						</View>
					</View>
				);
			} else {
				return (
					<View style={styles.contentHeight}>
						<View style={styles.panelViewContainer}>
							<View style={[styles.panelView, styles.panelEmptyView, panelViewBorder]}>
								<Image source={emptyPic} style={styles.emptyPic} />
								<Text style={styles.emptyText}>没有商品信息</Text>
							</View>
						</View>
					</View>);
			}

		} else if (curMenu == 'invoice') {
			//开票信息
			return (
				<View style={[styles.contentHeight]}>
					<View style={styles.panelViewContainer}>
						<View style={[styles.panelView, panelViewBorder]}>
							<View style={[styles.panelRowTop]}>
								<View style={[styles.panelRowTopLeft]}><Text style={styles.panelRowTopText}>开票信息</Text></View>
							</View>
							<PanelRow leftText={'纳税人识别号'} rightText={companyInfoVO.taxCode} />
							<PanelRow leftText={'开户行'} rightText={companyInfoVO.openBankName} />
							<PanelRow leftText={'开户行帐号'} rightText={companyInfoVO.openAcctNo} />
							<PanelRow leftText={'开票电话'} rightText={companyInfoVO.invoicePhoneNo} />
							<PanelRow leftText={'开票地址'} rightText={companyInfoVO.invoiceAddress} />
							<PanelRow leftText={'开票附件'} rightText={null} borderStyle={true} />
							{this._renderAttachmentView('taxQualificationFileSource')}
						</View>
					</View>
				</View>
			);
		} else if (curMenu == 'other') {
			//其他
			return (
				<View style={styles.contentHeight}>
					<View style={styles.panelViewContainer}>
						<View style={[styles.panelView, panelViewBorder]}>
							<View style={[styles.panelRowTop]}>
								<View style={[styles.panelRowTopLeft]}><Text style={styles.panelRowTopText}>其他</Text></View>
							</View>
							<PanelRow leftText={'备注'} rightText={companyInfoVO.comments} borderStyle={true} />
							{/* {this._renderAttachmentView('taxQualificationFileSource')} */}
						</View>
					</View>
				</View>
			);
		} else if (curMenu == 'standBook') {
			const companyStandBookView = this.renderCompanyStandBookData();

			return (
				<View style={[styles.contentHeight, { height: '100%' }]}>
					<View style={{ width: '100%', top: -18 * scale }}>
						{companyStandBookView}
					</View>
					<StatusModel  {...this.stateLightBoxData} textStyle={{ marginLeft: 15 * scale, marginRight: 5 * scale }} />
				</View>
			);
		} else if (curMenu == 'orderInfo') {
			const { orderInfoList } = enterpriseInfo;
			if (orderInfoList) {
				const { rows } = orderInfoList;
				if (rows && rows.length) {
					const orderInfoView = this._getOrderInfoView();
					const contentHeight = (rows.length < 3) ? styles.contentHeight : styles.content;
					return (
						<View style={contentHeight}>
							{orderInfoView}
						</View>
					);
				} else {
					return (
						<View style={styles.contentHeight}>
							<View style={styles.panelViewContainer}>
								<View style={[styles.panelView, styles.panelEmptyView, panelViewBorder]}>
									<Image source={emptyPic} style={styles.emptyPic} />
									<Text style={styles.emptyText}>没有交易信息</Text>
								</View>
							</View>
						</View>);
				}
			} else {
				return (
					<View style={styles.contentHeight}>
						<View style={styles.panelViewContainer}>
							<View style={[styles.panelView, styles.panelEmptyView, panelViewBorder]}>
								<Image source={emptyPic} style={styles.emptyPic} />
								<Text style={styles.emptyText}>没有交易信息</Text>
							</View>
						</View>
					</View>);
			}
		}
	}

	async componentWillMount () {
		this.getAllDetailInfo();

		const accountStr = await StorageHelper.get(STORAGE_CONSTANT.USER_INFO_KEY);
		if (accountStr && accountStr.length) {
			const { userRoles } = JSON.parse(accountStr);
			if (userRoles && userRoles.length) {
				userRoles.forEach((role) => {
					const { roleName, roleCode } = role;
					if (roleCode == 'ROLE_APP_LEADER') {
						this.setState({
							isLeader: true,
						});
					}
				});
			}
		}
	}

	componentWillUnmount () {
		pageNo = 1;
	}

	async componentDidMount () {
		DeviceEventEmitter.addListener('customerAddItemInfo', (res) => {
			if (!this.props.navigation.state.params.goBack) {
				const { bizType, companyId } = res;
				this.companyId = companyId;
				this.setState({
					loaded: true,
					dataAddressSource: [],
					dataQualificationSource: [],
				});
				this.getAllDetailInfo(bizType)
			}
		});

	}

	//查询详情，加载图片等数据
	async getAllDetailInfo (bizType) {
		//授信审批状态
		let creditFitlerTypes = await Dictionary.get('FIN_APP_CREDIT_APPLY_STATUS');

		//法人证件类型
		let legalIdcardTypeList = await Dictionary.get('ID_TYPE');
		//企业类型
		let companyTypeList = await Dictionary.get("COMPANY_PROP");

		//企业类型
		let companyPropList = await Dictionary.get("COMPANY_PROP");
		companyPropList.forEach(item => {
			const { dictKey, dictName } = item;
			companyPropObj[dictKey] = dictName;
		});

		//资质类型
		this.qualificationTypeList = await Dictionary.get("EC_QUALIFICATION_TYPE");
		this.qualificationTypeList.forEach(item => {
			const { dictKey, dictName } = item;
			qualificationTypeObj[dictKey] = dictName;
		});

		//合作关系
		const corpObj = {}
		let corpResult = await Dictionary.get("EC_CORP_TYPE");
		corpResult.forEach(item => {
			const { dictKey, dictName } = item;
			corpObj[dictKey] = dictName;
		});

		/**
 		* 返回enterpriseInfo
		* @param {String} companyId
		*/
		let enterpriseInfo;
		let params = {
			isPage: 0,
			companyId: this.companyId,
			pageNo: 1,
			// pageSize: 5,
		};
		//客户详情
		enterpriseInfo = await this.getDetail(params);

		if (enterpriseInfo) {
			if (!enterpriseInfo.acctList) { enterpriseInfo.acctList = {}; }
			if (!enterpriseInfo.invoiceVO) { enterpriseInfo.invoiceVO = {}; }
			if (!enterpriseInfo.companyInfoVO) { enterpriseInfo.companyInfoVO = {}; }

			if (enterpriseInfo.companyInfoVO.creditFile && enterpriseInfo.companyInfoVO.creditFile.length) {
				const fetchCreditFileAsync = await HTTP.GET(API_GENERATE(API.GET_IMG_VIEW), { fileId: enterpriseInfo.companyInfoVO.creditFile }, {
					rejectError: false,
					handleError: true
				}, 30000);

				if (fetchCreditFileAsync && fetchCreditFileAsync.image && fetchCreditFileAsync.image.length) {
					this.setState({
						creditFileSource: { uri: fetchCreditFileAsync.image }
					});
				}
			}

			if (enterpriseInfo.companyInfoVO.logo && enterpriseInfo.companyInfoVO.logo.length) {
				const fetchLogoAsync = await HTTP.GET(API_GENERATE(API.GET_IMG_VIEW), { fileId: enterpriseInfo.companyInfoVO.logo }, {
					rejectError: false,
					handleError: true
				}, 30000);
				if (fetchLogoAsync && fetchLogoAsync.image && fetchLogoAsync.image.length) {
					this.setState({
						logoUri: fetchLogoAsync.image
					});
				}
			}

			if (enterpriseInfo.companyInfoVO.invoiceFileId && enterpriseInfo.companyInfoVO.invoiceFileId.length) {
				const fetchInvoiceFileAsync = await HTTP.GET(API_GENERATE(API.GET_IMG_VIEW), { fileId: enterpriseInfo.companyInfoVO.invoiceFileId }, {
					rejectError: false,
					handleError: true
				}, 30000);
				if (fetchInvoiceFileAsync && fetchInvoiceFileAsync.image && fetchInvoiceFileAsync.image.length) {
					this.setState({
						taxQualificationFileSource: { uri: fetchInvoiceFileAsync.image }
					});
				}
			}

			//for 顶部标题
			this.props.navigation.setParams({
				title: enterpriseInfo.companyInfoVO.companyName,
			});

			let legalIdcardTypeText = '';
			if (enterpriseInfo.companyInfoVO.legalIdcardType && legalIdcardTypeList.length) {
				legalIdcardTypeList.forEach(item => {
					const { dictKey, dictName } = item;
					if (dictKey == enterpriseInfo.companyInfoVO.legalIdcardType) {
						legalIdcardTypeText = dictName;
					}
				});
			}

			let companyTypeText = '';
			if (enterpriseInfo.companyInfoVO.companyType && companyTypeList.length) {
				companyTypeList.forEach(item => {
					const { dictKey, dictName } = item;
					if (dictKey == enterpriseInfo.companyInfoVO.companyType) {
						companyTypeText = dictName;
					}
				});
			}

			const corpTypeList = enterpriseInfo.corpTypeList;
			const companyCorpStr = corpTypeList && corpTypeList.map(item => {
				return corpObj[item.corpType];
			}).join('/');

			let qualificationUriLoaded = true;
			if (enterpriseInfo.qualificationListPage && enterpriseInfo.qualificationListPage.rows && enterpriseInfo.qualificationListPage.rows.length) {
				this.qualificationListPage = enterpriseInfo.qualificationListPage.rows;
				this.qualificationListPage.forEach(async (item, i) => {
					if (item.qualificationAddress) {
						const qualificationArr = item.qualificationAddress.split(',');
						qualificationArr.map((id, index) => {
							// const { qualificationAddress } = item;

							this.loadedImgs(id, item.qualificationType, item.qualificationType);
						})
					}

					// if (i == this.qualificationListPage.length - 1) {
					qualificationUriLoaded = false;
					this.setState({ qualificationUriLoaded: false, });
					// }
				});
			} else {
				this.setState({ qualificationUriLoaded: false, });
			}

			let companyPropStr = '';
			if (enterpriseInfo.companyInfoVO.companyType && enterpriseInfo.companyInfoVO.companyType.length) {
				companyPropStr = companyPropObj[enterpriseInfo.companyInfoVO.companyType];
			}

			//获取授信信息
			const standBook = await HTTP.POST(API_GENERATE(API.GET_CUSTOMER_CREDIT_DETAIL), {
				companyId: this.companyId,
			});
			//取出对应的赊销/预付信息
			const standBookState = {};
			if (standBook) {
				standBook.map((item, index) => {
					standBookState[item.companyType] = item;
				})
			}
			this.getCreditHistory(this.companyId, this.currentCreditType || enterpriseInfo.companyInfoVO.companyType, this.creditApplyStatus || '');

			this.setState({
				enterpriseInfo: enterpriseInfo,
				loaded: false,
				companyCorpStr,
				legalIdcardTypeText,
				companyTypeText,
				companyPropStr,
				companyStandBook: standBookState,
				currentCreditType: this.currentCreditType || enterpriseInfo.companyInfoVO.companyType,
				creditFitlerTypes
			});
		} else {
			this.setState({ loaded: false, });
		}
	}

	async loadedImgs (id, type, dictKey) {
		if (id) {
			qualificationUriObj[type] = [];
			const fetchFileAsync = await HTTP.GET(API_GENERATE(API.GET_IMG_VIEW), { fileId: id }, {
				rejectError: false,
				handleError: true
			}, 30000);
			if (fetchFileAsync && fetchFileAsync.image && fetchFileAsync.image.length) {
				qualificationUriObj[type].push({ uri: fetchFileAsync.image });
			}
		}
	}
	//正式表详情（我的客户）
	async getDetail (params, type, editable) {
		let responseData;
		if (this.props.navigation.state.params.status === 'PASS') {
			//正式表正的客户详情
			responseData = await HTTP.POST(API_GENERATE(API.GET_CUSTOMER_DETAIL), params);
		} else {
			//审核的详情
			params.id = this.id;
			responseData = await HTTP.POST(API_GENERATE(API.GET_CUSTOMER_APPLY_DETAIL), params);
		}
		if (responseData) {
			if (responseData.addressListPage && responseData.addressListPage.rows.length > 0) {
				this.setState({
					dataAddressSource: params.pageNo == '1' ? responseData.addressListPage.rows : this.state.dataAddressSource.concat(responseData.addressListPage.rows)
				})
			}
			if (responseData.qualificationListPage && responseData.qualificationListPage.rows.length > 0) {
				let aa = this.state.dataQualificationSource.concat(responseData.qualificationListPage.rows).concat(responseData.qualificationListPage.rows)
				this.setState({
					dataQualificationSource: params.pageNo == '1' ? responseData.qualificationListPage.rows : this.state.dataQualificationSource.concat(responseData.qualificationListPage.rows),
				})
			}
			if (!type) {
				totalQualificationPage = responseData.qualificationListPage ? responseData.qualificationListPage.totalPage : null;
				totaAddresslPage = responseData.addressListPage ? responseData.addressListPage.totalPage : null;
			} else {
				if (type === 'address') {
					totaAddresslPage = responseData.addressListPage.totalPage;
				} else {
					totalQualificationPage = responseData.qualificationListPage.totalPage;
				}
			}

			this.checkIfEdit(responseData.staffCompanyList ? responseData.staffCompanyList : [], editable);
		}

		return responseData;
	}

	/**
	 * for 上传的附件
	 */
	_renderAttachmentView (attachment) {
		if (!attachment) {
			return null;
		} else {
			let onoff = false;
			const source = this.state[attachment] ? this.state[attachment] : emptyImgDetail;
			const style = this.state[attachment] ? styles.imgTappedEmpty : styles.imgTappedEmpty;
			if (!source.uri) return;
			if (appInfo.getBrand() == 'Xiaomi' && source.uri && source.uri.length > 3000000) {
				onoff = true;
			}
			return (
				<View style={styles.imgTappedWrap}>
					<View style={styles.imgTappedCell}>
						{
							!onoff ? <Image source={source} style={style} /> : <Text style={{ color: '#fff' }}>文件太大</Text>
						}
					</View>
				</View>
			);
		}
	}

	_closeLightBox () {
		this.stateLightBoxData.modalVisible = false;
		const { stateLightBoxVisible } = this.state;
		this.setState({
			stateLightBoxVisible: !stateLightBoxVisible,
		});
	}

	//获取授信审批节点
	async	didPressShowStateLightBox (creditApplyId, processInstanceId) {
		//查询审批节点
		let stateInfo = await HTTP.GET(API_GENERATE(API.FIND_NODE), {
			processInstanceId,
			bizId: creditApplyId,
			bizObjType: '11'
		});

		this.stateLightBoxData.modalVisible = true;
		this.stateLightBoxData.title = '审批状态';
		this.stateLightBoxData.rowDataList = stateInfo && stateInfo.map((item, index) => {
			return {
				taskName: item.taskName,
				auditTime: item.auditTime,
				auditResult: item.auditResult,
				remark: item.remark,
				logId: item.logId,
				auditStaffName: item.auditStaffName
			};
		})

		const { stateLightBoxVisible } = this.state;
		this.setState({
			stateLightBoxVisible: !stateLightBoxVisible
		});
	}
	async getCreditHistory (companyId, companyType, creditApplyStatus) {
		this.setState({
			loaded: true
		})
		const creditList = await HTTP.POST(API_GENERATE(API.GET_CUSTOMER_CREDIT_HISTORY), {
			companyId,
			companyType,
			creditApplyStatus
		});
		this.setState({
			loaded: false,
			creditList,
			creditApplyStatus
		})
	}

	//授信渲染
	renderCompanyStandBookData () {
		const { companyStandBook, ifEdit, currentCreditType, creditList, enterpriseInfo, creditFitlerTypes, creditApplyStatus } = this.state;
		const currCredit = companyStandBook && companyStandBook[currentCreditType] ? companyStandBook[currentCreditType] : null;
		return (
			<View style={{ backgroundColor: style.color.bgGray }}>
				<CreditTabs ifEdit={ifEdit} corpTypeList={enterpriseInfo.companyInfoVO.corpTypeList} currentCreditType={currentCreditType} onTextPress={() => {
					const { navigate } = this.props.navigation;
					navigate('CreditFormPage', {
						goBack: 'EnterpriseDetailPage',
						companyId: this.companyId || '',
						orderType: currentCreditType == 1 ? 'P' : 'S'
					})
				}} onPress={(key) => {
					this.setState({ currentCreditType: key });
					this.getCreditHistory(this.companyId, key, creditApplyStatus);
				}} />
				<BoxShadow setting={shadowOpt}>
					<CreditInfoSection data={currCredit} currentCreditType={currentCreditType} onDetailPress={() => {
						const { navigate } = this.props.navigation;
						navigate('CreditDetailPage', {
							title: '授信-' + (currentCreditType === 1 ? '预付' : '赊销'),
							companyName: enterpriseInfo.companyInfoVO.companyName,
							creditInfo: currCredit
						})
					}} onBillPress={() => {
						const { navigate } = this.props.navigation;
						navigate('BillPage', {
							goBack: 'EnterpriseDetailPage',
							companyId: this.companyId,
							companyName: enterpriseInfo.companyInfoVO.companyName,
							corpType: currentCreditType === 1 ? 1 : 0
						})
					}} />
				</BoxShadow>
				<CreditFilterTabs creditFitlerTypes={creditFitlerTypes} creditApplyStatus={creditApplyStatus}
					onPress={(type) => {
						this.setState({ creditApplyStatus: type });
						this.getCreditHistory(this.companyId, currentCreditType, type);
					}} />
				{
					this.state.loaded ?
						<View style={styles.loadedCell}>
							<ActivityIndicator
								animating={true}
								color={'#fff'}
								size="small"
							/>
						</View> :
						<View style={{ top: -40 * scale }}>
							{
								creditList && creditList.length ?
									<FlatList
										data={creditList}
										renderItem={this.renderCreditHistoryItemView.bind(this)}
										onEndReachedThreshold={1}
										onRefresh={() => { this.getCreditHistory(this.companyId, currCredit.companyType, creditApplyStatus) }}
										refreshing={false}
									/>
									:
									<View style={{ alignItems: 'center' }}>
										<Image source={emptyPic} style={styles.emptyPic} />
										<Text style={styles.emptyText}>暂无数据～</Text>
									</View>
							}
						</View>
				}
			</View >
		)
	}

	renderCreditHistoryItemView (creditHistory) {
		return (
			<CreditHistoryItem data={creditHistory.item} ifEdit={this.state.ifEdit}
				didPressState={(creditApplyId, processInstanceId) => this.didPressShowStateLightBox(creditApplyId, processInstanceId)}
				reApplyPress={() => {
					const { navigate } = this.props.navigation;
					navigate('CreditFormPage', {
						echoData: creditHistory.item,
						orderType: creditHistory.item.creditKind === 'SX' ? 'S' : 'P',
					})
				}} />
		)
	}

	/* 地址渲染列表 */
	renderAddressData () {
		return (
			<FlatList
				data={this.state.dataAddressSource}
				renderItem={this._renderAddressItemView.bind(this)}
				onEndReachedThreshold={1}
				onEndReached={() => { this._onAddressEndReached() }}
				onRefresh={() => { this._onAddressRefresh() }}
				refreshing={false}
			/>
		);
	}

	_onAddressRefresh = () => {
		pageNo = 1
		const params = {
			isPage: 0,
			companyId: this.companyId,
			pageNo,
			// pageSize: 5,
			bizType: 'COMPANY_ADDRESS_INFO'
		};
		this.getDetail(params, 'address', true);
	}

	_onAddressEndReached = () => {
		if (totaAddresslPage > pageNo) {
			pageNo += 1
			const params = {
				isPage: 0,
				companyId: this.companyId,
				pageNo,
				// pageSize: 5,
				bizType: 'COMPANY_ADDRESS_INFO'
			};
			this.getDetail(params, 'address', true);
		}
	}

	//返回itemView
	_renderAddressItemView (address) {
		const { enterpriseInfo, ifEdit } = this.state;
		const { addressName, detailAddress, provinceName, cityName, areaName } = address.item;
		return (
			<View style={[styles.panelView, panelViewBorder, { paddingBottom: 12 * scale }]}>
				<View style={[styles.infoItem, { paddingBottom: 6 * scale }]}>
					<View style={[styles.panelRowTop]}>
						<View style={[styles.panelRowTopLeft]}><Text style={styles.panelRowTopText}>地址信息</Text></View>
						{
							ifEdit ?
								<TouchableOpacity activeOpacity={0.5} onPress={() => {
									const { navigate } = this.props.navigation;
									navigate('EnterpriseEditAddressPage', {
										companyAddress: address.item,
										areaText: provinceName + cityName + areaName,
										companyName: enterpriseInfo.companyInfoVO.companyName,
									});
								}}>
									<Image source={enterpriseEdit} style={styles.editIcon} />
								</TouchableOpacity>
								: null
						}

					</View>
					<View style={[styles.addressRow]}>
						<Text numberOfLines={2} style={styles.addressText}>{provinceName || ''} {cityName || ''} {areaName || ''} {addressName || detailAddress}</Text>
					</View>
				</View >
			</View >
		);
	}

	/* 地址资质列表 */
	renderQualificationData () {
		return (
			<FlatList
				data={this.state.dataQualificationSource}
				renderItem={this._renderQualificationItemView.bind(this)}
				onEndReachedThreshold={1}
				onEndReached={() => { this._onQualificationEndReached() }}
				onRefresh={() => { this._onQualificationRefresh() }}
				refreshing={false}
			/>
		);
	}

	_onQualificationRefresh = () => {
		pageNo = 1
		const params = {
			isPage: 0,
			companyId: this.companyId,
			pageNo: 1,
			// pageSize: 5,
			bizType: 'COMPANY_QUALIFI_INFO'
		};
		this.getDetail(params, 'qualification', true);
	}

	_onQualificationEndReached = () => {
		if (totalQualificationPage > pageQualificationNo) {
			pageQualificationNo += 1
			const params = {
				isPage: 0,
				companyId: this.companyId,
				pageNo: pageQualificationNo,
				// pageSize: 5,
				bizType: 'COMPANY_QUALIFI_INFO'
			};
			this.getDetail(params, 'qualification', true);
		}
	}

	//返回itemView
	_renderQualificationItemView (qualification) {
		let source = emptyImgDetail;
		let sourceImgs = [];
		const { isExpired, qualificationType, effectDate, expireDate, qualificationAddress } = qualification.item;
		const { qualificationUriLoaded } = this.state;
		let qualificationImgs;
		if (!qualificationUriLoaded) {
			if (qualificationUriObj[qualificationType]) {
				qualificationUriObj[qualificationType].map((item, index) => {
					sourceImgs.push(item);
				})
			}
		}
		const isExpiredInt = isExpired ? Number(isExpired) : 0;
		const prohibit = (isExpiredInt == 0) ? null : <Image source={prohibitSource} style={styles.prohibit} />;

		return (
			<View style={{ marginBottom: 14 * scale }}>
				<View style={[styles.panelRowTop]}>
					<View style={[styles.panelRowTopLeft]}><Text style={styles.panelRowTopText}>资质信息</Text></View>
				</View>
				<View style={[styles.qualificationRow]}>
					{
						sourceImgs.length > 0 ?
							sourceImgs.map((item, index) => {
								return (
									<View key={index} style={[styles.qualificationRowLeft]}>
										<Image source={item} style={styles.qualificationImg} />
									</View>
								)
							})
							: <View style={[styles.qualificationRowLeft]}>
								<Image source={source} style={styles.qualificationImg} />
							</View>
					}
					<View style={[styles.qualificationRowRight]}>
						{prohibit}
					</View>
				</View>
				<View style={[styles.qualificationRowContent]}>
					<View style={[styles.qualificationRowContentRow]}>
						<Text style={styles.text}>{qualificationTypeObj[qualificationType]}</Text>
					</View>
					<View style={[styles.qualificationRowContentRow]}>
						<Text style={styles.dateText}>有效期至：{this._getDateStr(expireDate)}</Text>
					</View>
				</View>
			</View >
		);
	}

	/**
	* for 联系人信息contactorList
	*/
	_getContactorView () {
		const { enterpriseInfo, loaded, ifEdit } = this.state;
		if (loaded) {
			return null;
		} else {
			if (enterpriseInfo.contactorList && enterpriseInfo.contactorList.length) {
				return enterpriseInfo.contactorList.map((item, index) => {
					const { contactorName, mobileNo, contactorDepart, contactorAddress, wechatNo, contactorPosition } = item;
					return (
						<View style={[styles.panelView, panelViewBorder]} key={index}>
							<View style={[styles.panelRowTop]}>
								<View style={[styles.panelRowTopLeft]}><Text style={styles.panelRowTopText}>联系人信息</Text></View>
								{
									ifEdit ?
										<TouchableOpacity activeOpacity={0.5} onPress={() => {
											const { navigate } = this.props.navigation;
											navigate('EnterpriseEditContactPage', {
												companyName: enterpriseInfo.companyInfoVO.companyName,
												countryCode: enterpriseInfo.companyInfoVO.countryCode,
												vo: item
											})
										}}>
											<Image source={enterpriseEdit} style={styles.editIcon} />
										</TouchableOpacity>
										: null
								}
							</View>
							<PanelRow leftText={'姓名'} rightText={contactorName} />
							<PanelRow leftText={'手机号'} rightText={mobileNo} />
							<PanelRow leftText={'微信号'} rightText={wechatNo} />
							<PanelRow leftText={'部门'} rightText={contactorDepart} />
							<PanelRow leftText={'地址'} rightText={contactorAddress} />
							<PanelRow leftText={'职位'} rightText={contactorPosition} borderStyle={true} />
							{/* <PanelRow leftText={'创建人'} rightText={createBy}/> */}
						</View>);
				})

			}
		}
	}

	/**
	* for商品信息goodsList
	*/
	_getGoodsView () {
		const { enterpriseInfo, loaded } = this.state;
		if (loaded) {
			return null;
		} else {
			if (enterpriseInfo.goodsList && enterpriseInfo.goodsList.length) {
				return enterpriseInfo.goodsList.map((item, index) => {
					const enabled = (item.enabled == 1) ? '启用' : '未启用';
					return (
						<View key={index} style={[styles.panelView, panelViewBorder, { paddingBottom: 12 * scale }]}>
							<View style={[styles.panelRowTop]}>
								<View style={[styles.panelRowTopLeft]}><Text style={styles.panelRowTopText}>商品信息</Text></View>
							</View>
							<View style={[styles.productRow]}>
								<Text style={styles.text}>{item.goodsCateNameRoute}</Text>
								<Text style={[styles.text, { fontSize: 16 * scale }]}>{item.goodsCateName}</Text>
							</View>
						</View>);
				})
			}
		}
	}

	/**
	*
	*/
	_getOrderInfoView () {
		const { enterpriseInfo, loaded } = this.state;
		if (loaded) {
			return null;
		} else {
			if (enterpriseInfo && enterpriseInfo.orderInfoList && enterpriseInfo.orderInfoList.length) {
				return (
					enterpriseInfo.orderInfoList.map((item, i) => {
						const { orderId, orderStatus, goodsName, price, quantity } = item;
						return (
							<View key={i} style={[styles.panelView, panelViewBorder]}>
								<View style={[styles.panelRowTop]}>
									<View style={[styles.panelRowTopLeft]}><Text style={styles.panelRowTopText}>交易信息</Text></View>
								</View>
								<View style={[styles.productRow]}>
									<Text style={styles.text}>{orderId}</Text>
									<Text style={[styles.text, { color: style.color.themeColor }]}>{orderStatus}</Text>
								</View>
								<PanelRow leftText={'销售商品'} rightText={goodsName} />
								<PanelRow leftText={'暂定价'} rightText={this._toMoney(price)} />
								<PanelRow leftText={'结算价'} rightText={this._toMoney(price)} />
								<PanelRow leftText={'数量'} rightText={quantity} borderStyle={true} />
							</View>
						)
					})
				)
			}
		}
	}

	_getDateStr (str) {
		if (!ValidateDataUtil.isEmpty(str)) {
			const currDate = (typeof str == 'string') ? new Date(str.replace(/-/g, '/')) : str;
			var y = currDate.getFullYear(),
				m = currDate.getMonth() + 1,
				d = currDate.getDate();
			var dateStr = "";
			dateStr += y + "." + (m < 10 ? "0" + m : m) + "." + (d < 10 ? "0" + d : d);
			return dateStr;
		} else {
			return '';
		}
	}

	_toMoney (num) {
		num = num.toFixed(2);
		num = parseFloat(num)
		num = num.toLocaleString();
		return num;
	}

	onModalBgPress (data) {
		const { optionCheck } = this.state;

		this.setState({
			optionCheck: {
				modalVisible: false,
				data: data,
				checkObj: optionCheck.checkObj,
			}
		})
	}

	onModalItemPress (type, data, index) {
		const { optionCheck, enterpriseInfo } = this.state;
		const { dictName, dictKey } = data[index];
		optionCheck.checkObj[type] = { dictKey };
		this.setState({
			optionCheck: {
				checkObj: optionCheck.checkObj,
				data: data,
				modalVisible: false,
			},
		});

		const { navigate } = this.props.navigation;
		navigate('EnterpriseEditQualificationPage', {
			qualificationVO: {
				companyId: this.companyId,
				id: this.id,
			},
			qualificationListFromDetail: enterpriseInfo.qualificationListPage || [],
			qualificationType: data[index],
			companyName: enterpriseInfo.companyInfoVO.companyName,
		})
	}
}

/**
 *
 * @param {Object} props leftText,rightText,borderStyle
											*/
function PanelRow (props) {
	const borderStyle = props.borderStyle ? { borderBottomWidth: 0 } : null;
	return (
		<View style={[styles.panelRow, borderStyle]}>
			<Text style={[styles.text, { flex: 1 }]}>{props.leftText}</Text>
			<Text style={[styles.text, { flex: 1, textAlign: 'right', paddingRight: 5 * scale }]}>{props.rightText}</Text>
		</View>
	);
}

const styles = StyleSheet.create({
	orderinfoRow: {
		flexDirection: 'row',
		borderBottomColor: '#e4e4e4',
		borderBottomWidth: 1 / PixelRatio.get(),
		paddingLeft: 10 * scale,
		paddingRight: 10 * scale,
	},
	orderinfoLeft: {
		justifyContent: 'center',
		width: 28 * scale,
		height: 45 * scale,
	},
	point: {
		width: 16 * scale,
		height: 16 * scale,
	},
	orderinfoRight: {
		flex: 1,
		justifyContent: 'space-between',
		alignItems: 'center',
		flexDirection: 'row',
	},
	content: {
		alignItems: 'center',
		flex: 1
	},
	contentHeight: {
		width: 375 * scale,
		alignItems: 'center',
		flex: 1
	},
	qualificationRow: {
		flexDirection: 'row',
		marginTop: 10 * scale,
	},
	qualificationImg: {
		width: 68 * scale,
		height: 68 * scale,
	},
	qualificationRowLeft: {
		flex: 2,
		height: 68 * scale,
	},
	qualificationRowContent: {
		flex: 7,
		paddingLeft: 10 * scale,
	},
	qualificationRowContentRow: {
		flex: 1,
		justifyContent: 'center',
		marginTop: 20 * scale
	},
	qualificationRowRight: {
		flex: 1,
		justifyContent: 'center',
	},
	prohibit: {
		width: 28 * scale,
		height: 28 * scale,
	},
	productRow: {
		width: '100%',
		flexDirection: 'row',
		alignItems: 'center',
		justifyContent: 'space-between',
		height: 54 * scale,
	},
	dateText: {
		fontSize: 13 * scale,
		color: '#404040'
	},
	tabBarUnderline: {
		backgroundColor: '#fff',
		height: 2 * scale,
	},
	imgTappedWrap: {
		width: '100%',
		height: 213 * scale,
		alignItems: 'center',
	},
	imgTappedCell: {
		width: 305 * scale,
		height: 193 * scale,
		justifyContent: 'center',
		alignItems: 'center',
		backgroundColor: style.color.themeColor,
	},
	imgTappedEmpty: {
		width: 305 * scale,
		height: 193 * scale,
	},
	imgTapped: {
		width: 246 * scale,
		height: 180 * scale,
	},
	emptyPic: {
		width: 143 * scale,
		height: 120 * scale,
	},
	emptyText: {
		marginTop: 16 * scale,
		fontSize: 13 * scale,
		color: '#4B4B4B'
	},
	topMenuCell: {
		backgroundColor: style.color.themeColor,
		marginBottom: 14 * scale,
	},
	topMenuContent: {
		height: 50 * scale,
		flexDirection: 'row',
		alignItems: 'center',
		paddingLeft: 18 * scale,
	},
	topMenu: {
		marginRight: 27 * scale,
		paddingLeft: 3 * scale,
		paddingRight: 3 * scale,
		paddingBottom: 7 * scale,
		borderBottomColor: style.color.themeColor,
		borderBottomWidth: 2 / PixelRatio.get(),
	},
	topMenuCur: {
		borderBottomColor: '#fff',
	},
	topMenuText: {
		color: '#ADF7E9',
		fontSize: 12 * scale,
	},
	topMenuTextCur: {
		color: '#fff',
	},
	loadedCell: {
		width: 75 * scale,
		height: 75 * scale,
		backgroundColor: 'rgba(0, 0, 0, .5)',
		borderRadius: 7,
		justifyContent: 'center',
		alignItems: 'center',
		position: 'absolute',
		left: 140 * scale,
		top: 150 * scale,
	},
	infoItem: {
		width: 327 * scale,
	},
	addressRow: {
		paddingTop: 14 * scale,
	},
	addressText: {
		fontSize: 12 * scale,
		color: '#404040'
	},
	infoCell: {
		borderBottomColor: '#e4e4e4',
		borderBottomWidth: 1 / PixelRatio.get(),
	},
	infoCellRow: {
		flexDirection: 'row',
		width: 327 * scale,
	},
	infoCellRowRight: {
		flex: 1,
		justifyContent: 'center',
	},
	explainText: {
		fontSize: 12 * scale,
		color: '#404040',
		marginBottom: 4 * scale,
	},
	labelText: {
		lineHeight: 24 * scale,
		paddingLeft: 9 * scale,
		paddingRight: 9 * scale,
		backgroundColor: '#EDEDED',
		borderRadius: 10,
		marginRight: 12 * scale,
		color: '#4B4B4B',
		fontSize: 12 * scale,
		height: 24 * scale,
	},
	enterpriseText: {
		fontSize: 14 * scale,
		color: '#404040',
		paddingTop: 6 * scale,
		paddingBottom: 7 * scale,
	},
	enterpriseTitle: {
		flexDirection: 'row',
		justifyContent: 'space-between',
		width: 332 * scale,
		marginBottom: 11 * scale,
	},
	panelRowTop: {
		width: '100%',
		justifyContent: 'space-between',
		alignItems: 'center',
		flexDirection: 'row'
	},
	panelRowTopText: {
		fontSize: 12 * scale,
		color: style.color.themeColor,
	},
	editIcon: {
		width: 16 * scale,
		height: 16 * scale,
	},
	panelRow: {
		borderBottomColor: '#e4e4e4',
		borderBottomWidth: 1 / PixelRatio.get(),
		width: 320 * scale,
		height: 54 * scale,
		alignItems: 'center',
		justifyContent: 'space-between',
		flexDirection: 'row'
	},
	adressRow: {
		borderBottomColor: '#e4e4e4',
		borderBottomWidth: 1 / PixelRatio.get(),
		width: 327 * scale,
		flexDirection: 'row',
		alignItems: 'center',
	},
	adressRowLeft: {
		flex: 2,
		justifyContent: 'center',
		height: 54 * scale,
	},
	adressRowRight: {
		flex: 7,
		paddingTop: 10 * scale,
		paddingBottom: 10 * scale,
		alignItems: 'flex-end'
	},
	panelRowTopLeft: {
		flex: 1
	},
	panelCellView: {
		flex: 1,
		alignItems: 'center',
	},
	panelViewTop: {
		backgroundColor: style.color.themeColor,
		width: 375 * scale,
		height: 30 * scale,
	},
	panelViewContainer: {
		top: -18 * scale,
		width: 351 * scale,
	},
	panelView: {
		width: 351 * scale,
		alignItems: 'center',
		backgroundColor: '#fff',
		paddingTop: 16 * scale,
		paddingLeft: 12 * scale,
		paddingRight: 12 * scale,
		borderRadius: 4,
		shadowColor: '#D2D2D2',
		shadowOffset: { width: 0, height: 2 * scale },
		shadowRadius: 4 * scale,
		shadowOpacity: 0.5,
		marginBottom: 12 * scale,
	},
	panelEmptyView: {
		height: 375 * scale,
		justifyContent: 'center',
		alignItems: 'center',
	},
	panelEditView: {
		paddingTop: 16 * scale,
		alignItems: 'center',
		width: 332 * scale,
	},
	panelEditRow: {
		flexDirection: 'row',
		justifyContent: 'space-between',
		marginBottom: 7 * scale,
		width: 292 * scale,
	},
	text: {
		fontSize: 14 * scale,
		color: '#404040'
	},
	textSuccess: {
		color: style.color.themeColor,
	},
	textFail: {
		color: '#EE5D5D'
	},
	textGray: {
		color: '#8B8B8B'
	},
	panelViewBorder: {
		borderColor: '#F1F1F1',
		borderWidth: 1 / PixelRatio.get(),
	},
	addBtn: {
		justifyContent: 'center',
		alignItems: 'center',
		width: 288 * scale,
		height: 36 * scale,
		backgroundColor: style.color.themeColor,
		borderRadius: 100,
		marginTop: 10 * scale,
	},
	addBtnText: {
		fontSize: 14 * scale,
		color: '#fff'
	},
	arrowLeft: {
		width: 6 * scale,
		height: 11 * scale,
		paddingLeft: 5 * scale,
	},
});